package com.ms.demo.demo2;

/**
 * @description: 客户端执行
 * @author: ms
 * @create: 2022-10-28 10:34
 */
public class TestMain {

    public static void main(String[] args) {
        // 结构对象
        ObjectStructure collection = new ObjectStructure();
        // 访问者A
        IVisitor visitorA = new ConcreteVisitorA();
        collection.accept(visitorA);
        System.out.println("------------------------------------");
        // 访问者B
        IVisitor visitorB = new ConcreteVisitorB();
        collection.accept(visitorB);
    }

}